package cn.wolfcode.trip.base.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;


@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@JsonIgnoreProperties("handler")
public class OfComment extends BaseDomain {

    public static final boolean ISNOTVIEWED = false;//未被查看的状态
    public static final boolean ISVIEWED = true;//已被查看的状态

    private Comment comment;

    //评论人
    private User commentator;

    //回复人
    private User replier;

    //点赞人
    private User liker;

    //是否已查看,默认未
    private Boolean isViewed = ISNOTVIEWED;

    //内容字段
    private String content;

    //评论的日期
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    //统计对楼主的回复的回复数
    private Integer ofOfCommentNums;
    //统计对楼主的回复的点赞数
    private Integer ofOfCommentLikers;

    private Long parentId;

    //接受网页传过来的数据
    private String tempContent;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date tempDate;

}